package com.zg.common.core.dao.scf.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zg.common.core.dao.scf.entity.Company;
import com.zg.common.core.dao.scf.entity.CompanyApply;
import org.apache.ibatis.annotations.*;

@Mapper
public interface CompanyApplyMapper extends BaseMapper<CompanyApply> {
    @Select("SELECT * FROM SCF_COMPANY_APPLY WHERE id = #{id}")
    @Results({
            @Result(id = true, property = "id", column = "id"),
            @Result(property = "agentPerson", column = "id",
                    one = @One(select = "com.zg.common.core.dao.scf.mapper.PersonApplyMapper.getAgent")),
            @Result(property = "contactPerson", column = "id",
                    one = @One(select = "com.zg.common.core.dao.scf.mapper.PersonApplyMapper.getContact")),
    })
    Company getCompanyApply(Long id);
}
